package com.cskaoyan.model.vo;
import com.cskaoyan.model.GoodsList;
import com.cskaoyan.model.HandleOption;
import lombok.Data;

import java.util.List;

/**
 * @description：微信小程序订单接受对象
 * @author     ：huzhouming
 * @date       ：2022/5/9 15:50
 */

public class WxOrderListVO {


    /**
     * orderStatusText : 已取消(系统)
     * aftersaleStatus : 0
     * isGroupin : false
     * orderSn : 20220509520016
     * actualPrice : 69.0
     * goodsList : [{"number":1,"picUrl":"http://182.92.235.201:8083/wx/storage/fetch/h4q1on6uzta0ii3rsuvr.jpg","price":169,"id":176,"goodsName":"Shark","specifications":["M"]}]
     * id : 136
     * handleOption : {"cancel":false,"confirm":false,"rebuy":false,"pay":false,"comment":false,"delete":true,"aftersale":false,"refund":false}
     */
    private String orderStatusText;
    private int aftersaleStatus;
    private boolean isGroupin = false;
    private String orderSn;
    private double actualPrice;
    private List<GoodsList> goodsList;
    private int id;
    private HandleOption handleOption = new HandleOption();
    private Short orderStatus;

    public String getOrderStatusText() {
        return orderStatusText;
    }

    public void setOrderStatusText(String orderStatusText) {
        this.orderStatusText = orderStatusText;
    }

    public int getAftersaleStatus() {
        return aftersaleStatus;
    }

    public void setAftersaleStatus(int aftersaleStatus) {
        this.aftersaleStatus = aftersaleStatus;
    }

    public String getOrderSn() {
        return orderSn;
    }

    public void setOrderSn(String orderSn) {
        this.orderSn = orderSn;
    }

    public double getActualPrice() {
        return actualPrice;
    }

    public void setActualPrice(double actualPrice) {
        this.actualPrice = actualPrice;
    }

    public List<GoodsList> getGoodsList() {
        return goodsList;
    }

    public void setGoodsList(List<GoodsList> goodsList) {
        this.goodsList = goodsList;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public HandleOption getHandleOption() {
        return handleOption;
    }

    public void setHandleOption(HandleOption handleOption) {
        this.handleOption = handleOption;
    }

    public Short getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Short orderStatus) {
        switch (orderStatus){
            case 101:
                this.orderStatusText = "未付款";
                this.handleOption.setCancel(true);
                this.handleOption.setPay(true);
                break;
            case 102:
                this.orderStatusText = "用户取消";
                this.handleOption.setDelete(true);
                break;
            case 103:
                this.orderStatusText = "系统取消";
                this.handleOption.setDelete(true);
                break;
            case 201:
                this.orderStatusText = "已付款";
                this.handleOption.setRefund(true);
                break;
            case 202:
                this.orderStatusText = "申请退款";
                break;
            case 203:
                this.orderStatusText = "已退款";
                this.handleOption.setDelete(true);
                break;
            case 301:
                this.orderStatusText = "已发货";
                this.handleOption.setConfirm(true);
                break;
            case 401:
                this.orderStatusText = "用户收货";
                this.handleOption.setDelete(true);
                this.handleOption.setAftersale(true);
                this.handleOption.setRebuy(true);
                this.handleOption.setComment(true);
                break;
            case 402:
                this.orderStatusText = "系统收货";
                this.handleOption.setDelete(true);
                this.handleOption.setAftersale(true);
                this.handleOption.setRebuy(true);
                this.handleOption.setComment(true);
                break;
        }
    }

}
